home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_12_1986_Transactor_Publishing.d64 / kernal who.src3 < prev    next >
Text File  |  2023-02-26  |  2KB  |  44 lines

  1. ; program 3
  2. ; load screen contents from disk using name found in first variable
  3. ; declared in basic program calling this routine. The first variable
  4. ; should be a string variable.
  5. ;
  6. start     ldy #$02     ;offset to string length
  7. lda ($2d),y  ;get string length
  8. beq exit     ;zero length, quit while ahead
  9. pha          ;save length on stack
  10. iny          ;increment index
  11. lda ($2d),y  ;get low address of string
  12. tax          ;put in .x
  13. iny          ;increment index
  14. lda ($2d),y  ;get high order pointer
  15. tay          ;put in .y
  16. pla          ;pull length from stack
  17. jsr $ffbd    ;setnam: set command string
  18. lda #$01     ;logical file #1
  19. ldx #$08     ;device #8
  20. ldy #$02     ;secondary address
  21. jsr $ffba    ;setlfs: set logical file
  22. jsr $ffc0    ;open
  23. bcs exit     ;if carry set then error out
  24. ldx #$01     ;file number
  25. jsr $ffc6    ;chkin: set input channel to file 1
  26. ldy #$00     ;zero index
  27. sty $fc      ;zero index temp
  28. sty $fd      ;set pointer low byte
  29. lda #$04     ;start of screen high byte
  30. sta $fe      ;set pointer high byte
  31. loop      jsr $ffe4    ;getin: get a byte from disk
  32. ldy $fc      ;get index temp
  33. sta ($fd),y  ;store byte on screen
  34. inc $fc      ;increment index
  35. bne loop     ;not 256 yet?
  36. inc $fe      ;increment high byte of pointer
  37. lda $fe      ;get pointer high byte
  38. cmp #$08     ;done four pages yet?
  39. bcc loop     ;if carry clear then no
  40. lda #$01     ;file number 1
  41. jsr $ffc3    ;close: close the file
  42. exit      jsr $ffe7    ;clall: restore default i/o
  43. rts          ;return to basic
  44.